<div id="popwindowbackground" class="background" style="display: none;z-index: 6002 "></div>
<div id="popWindowLayout" class="addForm" style="width:400px;box-sizing: border-box;z-index: 6002">
    <div id="popWidnowTitleLayout"
         style="background: #1d7db1;padding:8px;text-align: center;position: relative;color:#fff;">
        <span id="popWindowTitle"></span>
        <icon class="topRightClose icon-shanchu1" style="font-size:25px;margin-top: 3px;"></icon>
    </div>
    <div id="popWindowLayoutInner" style="position:relative;width:100%;box-sizing: border-box">

    </div>
</div>
<script language="javascript">
    var closeCallBack;
    $(document).ready(function () {
        niceScroll($("#popWindowLayoutInner"));
        $("#popWindowLayout").find(".icon-shanchu1,#cancenButton").click(function () {
            $("#popwindowbackground,#popWindowLayout").fadeOut();
            if (closeCallBack) {
                closeCallBack();
                closeCallBack = null;
            }
            try {
                exitWindows();
            } catch (ex) {
            }
        });

    });

    function popWindow(page, title, width, height, callback, _closeCallBack) {
        closeCallBack = _closeCallBack;
        $("#popWindowLayout").css({
            width: width
        });
        if (height != null) {
            $("#popWindowLayout").css({
                height: height
            });
            $("#popWindowLayoutInner").css({
                height: height - $("#popWidnowTitleLayout").outerHeight(true)
            })
        } else {
            $("#popWindowLayout,#popWindowLayoutInner").css({
                height: "auto"
            });
        }
        $("#popWindowTitle").html(title)
        $.ajax({
            url: page,
            type: "GET",
            async: true,
            dataType: "html",
            success: function (res) {
                $("#popWindowLayoutInner").html(res);
                $("#popWindowLayoutInner").find("#cancenButton").click(function () {
                    hidePopWindow();
                    try {
                       exitWindows();
                    } catch (ex) {
                    }
                });

                var w = document.body.clientWidth;
                var h = document.body.clientHeight;
                var top = h / 2 - $("#popWindowLayout").height() / 2;
                var left = w / 2 - $("#popWindowLayout").width() / 2;
                $("#popWindowLayout").css({top: top + "px", left: left + "px"});
                $("#popwindowbackground,#popWindowLayout").fadeIn();
                $("#popWindowLayoutInner").css({
                    height: $("#popWindowLayout").height() - $("#popWidnowTitleLayout").height()
                });
                $("#popWindowLayoutInner").getNiceScroll().resize();
                if (callback != null) {
                    callback();
                }
            },
            error: function (err) {
                $("#popWindowLayout").html("模块加载失败")
            }
        });
    }
    function exitWindows(){

    }
    function hidePopWindow() {
        $("#popwindowbackground,#popWindowLayout").fadeOut();
    }

</script>